package com.syj.nodbweb.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
import org.springframework.context.annotation.Scope;

import java.util.concurrent.CompletableFuture;

/**
 * @ClassName : ThreadController
 * @Description :线程测试
 * @Author : 石蕴杰
 * @Date: 2020/7/1 21:53
 */
@Controller
@Api(value = "测试controller", tags = "测试controller")
@RequestMapping("/threadController")
public class ThreadController {
    @Autowired
    protected HttpServletRequest request;
    @Async("taskExecutor")
    @ApiOperation(value = "pageHelper方式查询")
    @GetMapping("/queryPageHelper")
    @ResponseBody
    public CompletableFuture<String> queryPageHelper(){
//        return "1";
        long i = -9999999999999L;
        while(i<9999999999999L){
            i++;
        }
        return CompletableFuture.completedFuture("1");
    }
}
